# Contributor: Martin Schmidt <martin.schmidt13@gmx.de>
# Maintainer: Martin Schmidt <martin.schmidt13@gmx.de>
pkgname=mediastreamer2-plugin-openh264
pkgver=5.2.0
pkgrel=1
pkgdesc="An H.264 encoder/decoder plugin for mediastreamer2 based on the openh264 library"
url="https://gitlab.linphone.org/BC/public/msopenh264"
arch="all"
license="GPL-2.0-or-later"
options="!check" # no test available
makedepends="
	bctoolbox-dev
	cmake
	mediastreamer2-dev
	openh264-dev
	ortp-dev
	samurai
	"
source="$pkgname-$pkgver.tar.gz::https://gitlab.linphone.org/BC/public/msopenh264/-/archive/$pkgver.tar.gz"
builddir="$srcdir/msopenh264-$pkgver-5c7a9522478f5eedc9a3e1600fdd705da1e00d23"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DCMAKE_MODULE_PATH=/usr/lib/cmake \
		-DCMAKE_SKIP_INSTALL_RPATH=ON \
		-DENABLE_SHARED=YES

	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --build build --target install
}
sha512sums="
b0c1a4fc4da98b170bb6f01b4d4f7d2418e1d08574682f50dabec415fe922e311395df7c643d8530fcf37afee70c5a2d3d9800363c84c6c096573e8758104cd8  mediastreamer2-plugin-openh264-5.2.0.tar.gz
"
